package com.ljc.serch.web;

import com.ljc.serch.service.Isearchservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("search")
public class SearchController {

    @Autowired
    private Isearchservice searchservice;

    /**
     * 自动补全
     * @param prefix
     * @return
     */
    @GetMapping("/suggestion")
    public List<Object> autoFill(@RequestParam("key") String prefix){
        return searchservice.getSuggestion(prefix);
    }



    /*@PostMapping("/filters")
    public Map<String,List<String>>  aggregation(@RequestParam ){

    }
*/
}
